import React, { Component } from 'react'
import './header.less'
import { withRouter } from 'react-router'
class Hrader extends Component {
    render() {
        let { title, path } = this.props.title
        // console.log(this.props);
        // console.log(this.props.title.age);
        return (
            <div className="header_box">
                <div className="iconfont icon-fanhui2" onClick={() => { this.fan() }}></div>
                <div>{title}</div>
                <div>
                    {this.props.title.age ? <button className="header_boxbtn" onClick={() => { this.props.subBtn() }}> {this.props.title.age} </button> : null}
                </div>
            </div >
        )
    }
    fan = () => {
        let { title, path } = this.props.title
        this.props.history.push(path)
    }
}
export default withRouter(Hrader)